<?php
class My_Model_Db extends Zend_Db_Table_Abstract
{
    protected $_mainTable = '';

    protected $_idFieldName = '';

    public function save($data, $id = null)
    {
        if ($id) {
            $where = $this->getAdapter()->quoteInto($this->_idFieldName . ' = ?', $id);
            $this->getAdapter()->update($this->_mainTable, $data, $where);
        } else {
            $this->getAdapter()->insert($this->_mainTable, $data);
        }
        return true;
    }

    public function remove($id)
    {
        $where = $this->getAdapter()->quoteInto($this->_idFieldName . ' = ?', $id);
        $this->getAdapter()->delete($this->_mainTable, $where);
    }
}